# writer:sp
# tiem: 2024/8/21 10:14
import os
path = 'N:/xiaosdechengzhangzhilu/python-language-learning/chart19、python常见的标准库/1、os操作系统接口'
# 检查路径是否存在
if os.path.exists(path):
    print("Path exists.")
else:
    print("Path does not exist.")

# 检查路径是否为文件
if os.path.isfile(path):
    print("It is a file.")
elif os.path.isdir(path):
    print("It is a directory.")
else:
    print("It is neither a file nor a directory.")